package com.sirun.ble.utils.sdk;

import static com.sirun.ble.constants.BleConfig.BleSdkTag;

import android.content.Context;

import com.sirun.ble.utils.AwByteUtil;
import com.sirun.ble.utils.AwLog;

public class CheryBleCmdUtil {

    /**
     * 开闭锁指令
     * @param context
     * @return
     */
    public static byte[] getEncryptLockCmd(boolean isLock) {
        byte[] dataByte = new byte[4];
        if(isLock) {
            AwLog.d(BleSdkTag, "*** 闭锁 ***");
            dataByte[0] = (byte) 0xAA;
            dataByte[1] = 0x22;
        } else {
            AwLog.d(BleSdkTag, "*** 开锁 ***");
            dataByte[0] = (byte) 0xAA;
            dataByte[1] = 0x11;
        }
        //输出明文数组
        AwLog.d(BleSdkTag, "解闭锁明文数组: " + AwByteUtil.printBytes(dataByte));
        return dataByte;
    }

}
